A rotary encoder, also called a shaft encoder, is an electro-mechanical device that converts the angular position of a shaft or axle to an analog or digital code, making it an angular transducer. Rotary encoders are used in many applications that require precise shaft unlimited rotation—including industrial controls, robotics, special purpose photographic lenses, computer input devices (such as opto-mechanical mice and trackballs), printers, and rotating radar platforms. There are two main types of rotary encoders: absolute and incremental (relative).
An incremental rotary encoder, also known as a quadrature encoder or a relative rotary encoder, traditionally has two outputs called quadrature outputs. These two outputs can be either mechanical or optical. In the optical type, there are traditionally two bar-window coded tracks, while the mechanical type has two contacts that are actuated by cams on the rotating shaft. Optical incremental encoders traditionally employ two outputs called A & B, which are called quadrature outputs, as they are 90 degrees out of phase.
A variation on the incremental encoder is the sinewave encoder. Instead of producing two quadrature square waves, the outputs are quadrature sine waves (a Sine and a Cosine). By performing the arctangent function, arbitrary levels of resolution can be achieved.
A typical two-channel incremental encoder generates at its output two chains of pulses shifted by 90 degrees. By counting pulses and checking the phase between the pulses (1st channel leading 2nd or vice versa), it is possible to determine the speed and direction of rotation. A significant improvement to a two-channel incremental encoder is a three-channel incremental encoder. The extra channel is index: once per revolution a pulse is generated, it serves as zero position reference so that incremental angular position might be then calculated.
The optical system for a two-channel incremental encoder is simplified by the fact that only one track (pattern of bars and windows) on the code wheel is enough. A straight forward implementation of a three-channel encoder would call for a second track on the code wheel indicating index. Unfortunately, introducing the second track required bigger area and hence constrains an optical system projecting code wheel pattern on the sensor area. This is a problem especially in a reflective encoder, whereby smaller size is preferred.